<template>
  <el-card class="box-card">
    <template #header>
      <div class="card-header">
        <span>列车时刻表</span>
        <div style="display: flex">
          <TrainNoInput></TrainNoInput>
          <el-button type="primary" :icon="Plus" @click="btn_showDialog"
            >添加列车时刻详情</el-button
          >
        </div>
      </div>
    </template>
    <ScheduleListTable></ScheduleListTable>
    <ScheduleDialog></ScheduleDialog>
  </el-card>
</template>

<script setup>
import ScheduleListTable from './ScheduleListTable.vue'
import TrainNoInput from './TrainNoInput.vue'
import { Plus } from '@element-plus/icons-vue'

import ScheduleDialog from './ScheduleDialog.vue'

import { useScheduleStore } from '../../stores/schedule'

const scheduleStore = useScheduleStore()

// const { dialogFormVisible } = storeToRefs(scheduleStore)
const btn_showDialog = () => {
  scheduleStore.preInfo4Add()
}
</script>

<style>
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.text {
  font-size: 14px;
}

.item {
  margin-bottom: 18px;
}

.box-card {
  margin-top: 1rem;
  width: 100%;
  border-radius: 1rem;
}
</style>
